<?php

return [
	
	/*
	|--------------------------------------------------------------------------
	| Horizon Redis Connection
	|--------------------------------------------------------------------------
	|
	| This is the name of the Redis connection where Horizon will store the
	| meta information required for it to function. It includes the list
	| of supervisors, failed jobs, job metrics, and other information.
	|
	*/
	
	'use' => 'default',
	
	/*
	|--------------------------------------------------------------------------
	| Horizon Redis Prefix
	|--------------------------------------------------------------------------
	|
	| This prefix will be used when storing all Horizon data in Redis. You
	| may modify the prefix when you are running multiple installations
	| of Horizon on the same server so that they don't have problems.
	|
	*/
	
	'prefix' => env('HORIZON_PREFIX', 'horizon:') . env('APP_KEY'),
	
	/*
	|--------------------------------------------------------------------------
	| Queue Wait Time Thresholds
	|--------------------------------------------------------------------------
	|
	| This option allows you to configure when the LongWaitDetected event
	| will be fired. Every connection / queue combination may have its
	| own, unique threshold (in seconds) before this event is fired.
	|
	*/
	
	'waits' => [
		'redis:default' => 60,
	],
	
	/*
	|--------------------------------------------------------------------------
	| Job Trimming Times
	|--------------------------------------------------------------------------
	|
	| Here you can configure for how long (in minutes) you desire Horizon to
	| persist the recent and failed jobs. Typically, recent jobs are kept
	| for one hour while all failed jobs are stored for an entire week.
	|
	*/
	
	'trim' => [
		'recent' => 60,
		'failed' => 10080,
	],
	
	/*
	|--------------------------------------------------------------------------
	| Queue Worker Configuration
	|--------------------------------------------------------------------------
	|
	| Here you may define the queue worker settings used by your application
	| in all environments. These supervisors and settings handle all your
	| queued jobs and will be provisioned by Horizon during deployment.
	|
	*/
	
	'environments' => [
		// 生产环境
		'production' => [
			'supervisor-1' => [
				'connection' => 'redis',
				'queue' => ['default', 'email', 'export', 'behavior'],
				'balance' => 'false',
				'processes' => 5,
				'tries' => 3,
			],
			'supervisor-2' => [
				'connection' => 'redis',
				'queue' => ['transfer'],
				'balance' => 'false',
				'processes' => 8,
				'tries' => 3,
			],
			'supervisor-3' => [
				'connection' => 'redis',
				'queue' => ['order_notify'],
				'balance' => 'false',
				'processes' => 8,
				'tries' => 1,
			],
		],
		
		// 测试环境
		'dev' => [
			'supervisor-1' => [
				'connection' => 'redis',
				'queue' => ['default', 'email', 'export', 'behavior'],
				'balance' => 'false',
				'processes' => 2,
				'tries' => 3,
			],
			'supervisor-2' => [
				'connection' => 'redis',
				'queue' => ['transfer'],
				'balance' => 'false',
				'processes' => 5,
				'tries' => 3,
			],
			'supervisor-3' => [
				'connection' => 'redis',
				'queue' => ['order_notify'],
				'balance' => 'false',
				'processes' => 5,
				'tries' => 1,
			],
		],
		
		// 本地开发环境
		'local' => [
			'supervisor-1' => [
				'connection' => 'redis',
				'queue' => ['default', 'email', 'export', 'behavior'],
				'balance' => 'false',
				'processes' => 2,
				'tries' => 3,
			],
			'supervisor-2' => [
				'connection' => 'redis',
				'queue' => ['transfer'],
				'balance' => 'false',
				'processes' => 2,
				'tries' => 3,
			],
			'supervisor-3' => [
				'connection' => 'redis',
				'queue' => ['order_notify'],
				'balance' => 'false',
				'processes' => 2,
				'tries' => 1,
			],
		],
	],
];
